/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Figuras;

/**
 *
 * @author Gustavo Canul Poot
 */
public abstract class Cuadrilatero {
    
    //atributos que tiene la clase Cuadrilatero

    private double x1;
    private double y1;
    private double x2;
    private double y2;
    private double x3;
    private double y3;
    private double x4;
    private double y4;

    private double dist;
    private double dist2;
    private double dist3;
    private double dist4;
    private double dist5;
    private double dist6;
    //atributos para generar las distancias entre dos puntos




            //fin de los atributos

    //constructor de la clase Cuadrilatero
    public Cuadrilatero(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
        this.x3 = x3;
        this.y3 = y3;
        this.x4 = x4;
        this.y4 = y4;
    }//fin constructor


    /**
     * @return the x1
     */
    public double getX1() {
        return x1;
    }

    /**
     * @param x1 the x1 to set
     */
    public void setX1(double x1) {
        this.x1 = x1;
    }

    /**
     * @return the y1
     */
    public double getY1() {
        return y1;
    }

    /**
     * @param y1 the y1 to set
     */
    public void setY1(double y1) {
        this.y1 = y1;
    }

    /**
     * @return the x2
     */
    public double getX2() {
        return x2;
    }

    /**
     * @param x2 the x2 to set
     */
    public void setX2(double x2) {
        this.x2 = x2;
    }

    /**
     * @return the y2
     */
    public double getY2() {
        return y2;
    }

    /**
     * @param y2 the y2 to set
     */
    public void setY2(double y2) {
        this.y2 = y2;
    }

    /**
     * @return the x3
     */
    public double getX3() {
        return x3;
    }

    /**
     * @param x3 the x3 to set
     */
    public void setX3(double x3) {
        this.x3 = x3;
    }

    /**
     * @return the y3
     */
    public double getY3() {
        return y3;
    }

    /**
     * @param y3 the y3 to set
     */
    public void setY3(double y3) {
        this.y3 = y3;
    }

    /**
     * @return the x4
     */
    public double getX4() {
        return x4;
    }

    /**
     * @param x4 the x4 to set
     */
    public void setX4(double x4) {
        this.x4 = x4;
    }

    /**
     * @return the y4
     */
    public double getY4() {
        return y4;
    }

    /**
     * @param y4 the y4 to set
     */
    public void setY4(double y4) {
        this.y4 = y4;
    }
   
    /**
     * @return the dist
     */
    public double getDist() {
        //Distancia entre los puntos (X1,Y1) (X2,Y2)
        double a = this.getX1()- this.getX2();
        double b = this.getY1()- this.getY2();
        return Math.sqrt(Math.pow(a,2)+Math.pow(b, 2));
       
    }

    /**
     * @param dist the dist to set
     */
    public void setDist(double dist) {
        this.dist = dist;
    }

    /**
     * @return the dist2
     */
    public double getDist2() {
        //Distancia entre los puntos (X1,Y1) (X4,Y4)
        double c = this.getX1()- this.getX4();
        double d = this.getY1()- this.getY4();
        return  Math.sqrt(Math.pow(c,2)+Math.pow(d, 2));

    }

    /**
     * @param dist2 the dist2 to set
     */
    public void setDist2(double dist2) {
        this.dist2 = dist2;
    }

    /**
     * @return the dist3
     */
    public double getDist3() {
         //Distancia entre los puntos (X1,Y1) (X3,Y3)
        double e = this.getX1()- this.getX3();
        double f = this.getY1()- this.getY3();
        return Math.sqrt(Math.pow(e,2)+Math.pow(f, 2));
    }

    /**
     * @param dist3 the dist3 to set
     */
    public void setDist3(double dist3) {
        this.dist3 = dist3;
    }

    /**
     * @return the dist4
     */
    public double getDist4() {
       //Distancia entre los puntos (X2,Y2) (X3,Y3)
        double g = this.getX2()- this.getX3();
        double h = this.getY2()- this.getY3();
        return Math.sqrt(Math.pow(g,2)+Math.pow(h, 2));
    }

    /**
     * @param dist4 the dist4 to set
     */
    public void setDist4(double dist4) {
        this.dist4 = dist4;
    }

    /**
     * @return the dist5
     */
    public double getDist5() {
        //Distancia entre los puntos (X2,Y2) (X4,Y4)
        double i = this.getX2()- this.getX4();
        double j = this.getY2()- this.getY4();
        return Math.sqrt(Math.pow(i,2)+Math.pow(j, 2));
    }

    /**
     * @param dist5 the dist5 to set
     */
    public void setDist5(double dist5) {
        this.dist5 = dist5;
    }

    /**
     * @return the dist6
     */
    public double getDist6() {
        //Distancia entre los puntos (X3,Y3) (X4,Y4)
        double k = this.getX3()- this.getX4();
        double l = this.getY3()- this.getY4();
        return  Math.sqrt(Math.pow(k,2)+Math.pow(l, 2));
    }

    /**
     * @param dist6 the dist6 to set
     */
    public void setDist6(double dist6) {
        this.dist6 = dist6;
    }



    //clase abstractta para calcular el area
    public abstract double area();
}
